package com.woniuxy.myfinance.service.ServiceImpl;

import com.woniuxy.commons.entity.UserDetails;
import com.woniuxy.commons.entity.Userinfo;
import com.woniuxy.myfinance.mapper.UserdetailsMapper;
import com.woniuxy.myfinance.service.UserdetailsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author author
 * @create 2021-11-22 11:09
 */
@Service
public class UserdetailsServiceImpl implements UserdetailsService {

    @Resource
    private UserdetailsMapper userdetailsMapper;


    @Override
    public void addUserdetails(UserDetails userDetails) {
      userdetailsMapper.addUserdetails(userDetails);
    }

    @Override
    public List<UserDetails> getAllUserdetails() {
        return userdetailsMapper.getAllUserdetails();
    }

    @Override
    public List<Userinfo> getUserBylon(String ulongitude) {
        String lon =ulongitude.substring(0, 6);
        String uidBylon = userdetailsMapper.getUidBylon(lon);
        List<Userinfo> userinfos = userdetailsMapper.getallUserinfoById(uidBylon);
        return userinfos;
    }




}
